﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LoggerApp
{
    class Program
    {
        static void Main(string[] args)
        {
            FileLogger.LogFilePath = @"d:\mylog.txt";

            FileLogger.Log("Starting");
            List<Task> tasks = new List<Task>();
            for (int i = 0; i < 5; i++)
            {
                tasks.Add(Task.Factory.StartNew(() =>
                    {
                        FileLogger.Log("Hello from {0}", Task.CurrentId);
                    }
                ));
            }
            Task.WaitAll(tasks.ToArray());
            FileLogger.Log("Ending");

            Console.WriteLine("Press RETURN key to exit.");
            Console.ReadLine();
        }
    }
}
